//
//  SelectJobCategoryViewController.m
//  Btpin
//
//  Created by Vic on 2019/5/30.
//  Copyright © 2019 Vic. All rights reserved.
//

#import "SelectJobCategoryViewController.h"
#import "PSSelectJobCategoryView.h"

@interface SelectJobCategoryViewController ()
@property (nonatomic, strong) PSSelectJobCategoryView *cityView;
@end

@implementation SelectJobCategoryViewController

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    [self.navigationController setNavigationBarHidden:NO animated:YES];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    [self initUI];
}
- (void)initUI {
    self.view.backgroundColor = COLOR_OF_WHITE;
    
    UIButton *okBtn = [UIToolsControl initButtonWithFrame:CGRectMake(WIDTH-50*Scale, HeightOfStatusBar+3*Scale, 50*Scale, 36*Scale) imageName:nil target:self action:@selector(okBtnTap) title:@"确定" titleColor:THEMECOLOR_OF_ORANGE];
    okBtn.titleLabel.font = Font(Font_15);
    UIBarButtonItem *rightItem = [[UIBarButtonItem alloc] initWithCustomView:okBtn];
    self.navigationItem.rightBarButtonItem = rightItem;
    
    self.cityView = [[PSSelectJobCategoryView alloc] initWithFrame:CGRectMake(0, 0, WIDTH, HEIGHT-HeightOfStatusBarAndNavigationBar-SIMEmojKeyBoardkBottomNOSafeArea_Height)];
    [self.view addSubview:self.cityView];
}
- (void)okBtnTap {
    if (self.delegate && [self.delegate respondsToSelector:@selector(selectJobCategoryViewControllerInfo:)]) {
        SelectJobCategoryModel *model = [self.cityView getAllInfo];
        [self.delegate selectJobCategoryViewControllerInfo:[model copy]];
        [self.navigationController popViewControllerAnimated:YES];
    }
}

@end
